package com.whfc.emp.service;

import com.github.pagehelper.Page;
import com.whfc.common.exception.BizException;
import com.whfc.common.result.ListData;
import com.whfc.common.result.PageData;
import com.whfc.emp.dto.*;
import com.whfc.emp.param.AppPayrollAddParam;
import com.whfc.emp.param.AppPayrollDetailEditParam;
import com.whfc.emp.param.AppPayrollListParam;
import com.whfc.entity.dto.OssPathDTO;

import java.util.List;

/**
 * 人员工资
 *
 * @author guodong_sun
 * @Description:
 * @date 2019年9月3日
 */
public interface AppPayrollService {

    /**
     * 工资发放记录列表
     *
     * @param request
     * @return
     * @throws BizException
     */
    PageData<AppPayrollDTO> list(AppPayrollListParam request) throws BizException;

    /**
     * 工资发放详情
     *
     * @param payrollId
     * @return
     * @throws BizException
     */
    AppPayrollDetailDTO detail(Integer payrollId) throws BizException;


    /**
     * 查询发放工资人员列表
     * @param payrollId
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageData<AppPayrollEmpDTO> empPayrollList(Integer payrollId,Integer pageNum,Integer pageSize);

    /**
     * 添加工资记录
     *
     * @param request
     * @return
     * @throws BizException
     */
    void add(AppPayrollAddParam request) throws BizException;

    /**
     * 修改员工工资信息
     *
     * @param request
     * @throws BizException
     */
    void edit(AppPayrollDetailEditParam request) throws BizException;

    /**
     * 删除工资记录
     *
     * @param payrollId
     * @throws BizException
     */
    void del(Integer payrollId) throws BizException;

    /**
     * 提交工资发放
     *
     * @param payrollId
     * @throws BizException
     */
    void commit(Integer payrollId) throws BizException;

    /**
     * 添加工资发放附件
     *
     * @param filename
     * @param url
     * @param payrollId
     * @return
     * @throws BizException
     */
    AppPayrollAttachAddDTO attachAdd(String filename, String url, Integer payrollId) throws BizException;

    /**
     * 删除工资附件
     *
     * @param attachId
     * @throws BizException
     */
    void attachDel(Integer attachId) throws BizException;

    /**
     * 批量添加员工工资
     *
     * @param list
     * @param payrollId
     * @throws BizException
     */
    void addList(List<AppPayrollEmpDTO> list, Integer payrollId) throws BizException;

    /**
     * 根据人员id查找工资发放列表
     *
     * @param empId
     * @return
     * @throws BizException
     */
    ListData<AppPayrollEmpDTO> getPayrollList(Integer empId) throws BizException;

    /**
     * 查询
     *
     * @param projectId
     * @param groupId
     * @param year
     * @param month
     * @param keyword
     * @return
     */
    List<EmpSyncDTO> getPayrollList(Integer projectId, Integer groupId, Integer year, Integer month, String keyword) throws BizException;

    /**
     * 查找个人的工资同步信息
     *
     * @param id
     * @return
     */
    AppPayrollSyncDTO getSyncDTO(Integer id) throws BizException;

    /**
     * 导出工资列表
     * @param payrollId
     * @return
     * @throws BizException
     */
    OssPathDTO export(Integer payrollId) throws BizException;
}
